package com.atguigu.jxc.controller;


import com.atguigu.jxc.domain.ServiceVO;
import com.atguigu.jxc.entity.GoodsType;
import com.atguigu.jxc.entity.GoodsTypeVO;
import com.atguigu.jxc.service.GoodsTypeService;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * @description 商品信息Controller
 */
@Controller
@RequestMapping("/goodsType")
@ResponseBody
public class GoodsTypeController {

    @Autowired
    private GoodsTypeService goodsTypeService;

    /**
     * 查询商品所有分类
     * @return
     */
    @RequestMapping("/loadGoodsType")
    public List<GoodsTypeVO> loadGoodsType() {
        return goodsTypeService.loadGoodsType();
    }


    @RequestMapping("/save")
    public ServiceVO save(String  goodsTypeName, Integer  pId)
    {
        return goodsTypeService.save(goodsTypeName,pId);
    }

}
